<template>
  <div class="app-container">
    <el-form :inline="true" :model="queryForm" class="demo-form-inline">
      <el-form-item label="评价人昵称">
        <el-input v-model="queryForm.user" placeholder="评价人昵称"></el-input>
      </el-form-item>
      <el-form-item label="评价时间">
        <div class="block">
          <el-date-picker
            v-model="queryDate"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期">
          </el-date-picker>
        </div>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="initData">查询</el-button>
      </el-form-item>
    </el-form>
    <el-table
      :data="tableData"
      stripe
      max-height="40%"
      style="width: 100%">
      <el-table-column
        prop="proInfo.proName"
        label="项目名称">
      </el-table-column>
      <el-table-column
        prop="proInfo.createTime"
        label="项目创建时间">
      </el-table-column>
      <el-table-column
        prop="pingjiaInfo.createDate"
        label="评价时间">
      </el-table-column>
      <el-table-column
        prop="pingjiaInfo.content"
        label="评价内容">
      </el-table-column>
      <el-table-column
        prop="pingjiaInfo.otherName"
        label="评价人">
      </el-table-column>
    </el-table>
    <el-pagination
      background
      :page-size="10"
      :pager-count="7"
      layout="prev, pager, next"
      :total="total">
    </el-pagination>
  </div>

</template>

<script>

  import pingjia from "@/api/basicdata/pingjia";

  export default {
    data() {
      return {
        queryDate:null,
        queryForm:{},
        total:0,
        tableData: []
      }
    },
    created() {
      this.initData();
    },
    methods:{
      initData(){
        if (this.queryDate){
          this.queryForm.beginCreateTime = this.queryDate[0];
          this.queryForm.endCreateTime = this.queryDate[1];
        }
        pingjia.pageList(this.queryForm).then((res)=>{
          this.tableData = res.rows;
          this.total = res.total;
        });
      }
    }
  }
</script>
